package com.biboheart.adapter.express.support;

import com.biboheart.adapter.express.operation.Logical;

import java.math.BigDecimal;

final class LogicalGreaterCalculate implements Logical {
    @Override
    public Boolean calc(Object left, Object right) {
        if (!(left instanceof Number) || !(right instanceof Number)) {
            return false;
        }
        return new BigDecimal(String.valueOf(left)).compareTo(new BigDecimal(String.valueOf(right))) > 0;
    }

    @Override
    public Boolean calc(Boolean source) {
        return false;
    }
}
